
class Todo(object):
# 表示一个完整的待办事项

    current_todo_id = 1

    @classmethod
    def next_id(cls):
        todo_id = Todo.current_todo_id
        Todo.current_todo_id += 1

        return todo_id

    def __init__(self,title:str,id:int = 0,completed = False):
        self.id = id if id > 0 else Todo.next_id()
        self.title = title
        self.completed = completed